//by Tankbuster
//#define __DEBUG__
#define THIS_FILE "fn_clearnavalmines.sqf"
#include "x_setup.sqf"

if !(call FUNC(checkSHC)) exitWith {};

private ["_mpos","_x", "_mines"];
PARAMS_2(_mpos,_mines);

while {!GVAR(sm_resolved)} do {
	sleep 5;
	if (({mineActive _x} count _mines) == 0) exitWith {
		GVAR(sm_winner) = 2;
		GVAR(sm_resolved) = true;
	};
};

if (GVAR(IS_HC_CLIENT)) then {
	[QGVAR(sm_var), GVAR(sm_winner)] call FUNC(NetCallEventCTS);
};

sleep 5;

{
	deleteVehicle _x;
} forEach _mines;
